package com.springbootjsp.controller;

import com.springbootjsp.model.User;
import com.springbootjsp.service.impl.TestServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class UserController {
    @Autowired
    TestServiceImpl testService;
    @GetMapping("/aaa")
    @ResponseBody
    public List<User> print(){
        List<User> findall = testService.findall();
        return findall;
    }

    @GetMapping("/aa")
    public String print1(){
        return "index";
    }
}
